package com.lpf.testJVM;

import java.util.ArrayList;
import java.util.List;

public class HeapOOM {

	static class OOMObject {
	}

	/**
	 * VM Args: -Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
	 */
	public static void main(String[] args) {
		List<OOMObject> list = new ArrayList<>();

		while (true) {
			list.add(new OOMObject());
		}
	}
}
